package com.kurumi.util;

import java.io.OutputStream;
import java.math.BigDecimal;
import java.nio.charset.Charset;
import java.text.ParseException;
import java.util.Date;
import java.util.List;
import java.util.Map;

import com.linuxense.javadbf.DBFDataType;
import com.linuxense.javadbf.DBFException;
import com.linuxense.javadbf.DBFField;
import com.linuxense.javadbf.DBFWriter;

public class JavaDBFUtils {

	/**
	 * 导出HQMS病案首页DBF文件
	 * @param out
	 * @param datas
	 * @throws DBFException
	 */
	public static void exportHQMSDBFOfPageIndex(OutputStream out,List<Map<String, Object>> datas) throws DBFException {
		DBFWriter writer = new DBFWriter(out, Charset.forName("GBK"));
		DBFField[] fields = getHeadsOfPageIndexHQMS();
		writer.setFields(fields);
		addRecordOfPageIndexHQMS(writer,datas,fields.length);
		writer.close();
	}

	/**
	 * 获取HQMS病案首页DBF文件列信息
	 * @return
	 */
	private static DBFField[] getHeadsOfPageIndexHQMS() {
		DBFField[] fields = new DBFField[346];
		//[start] 0-19
		fields[0] = new DBFField();
		fields[0].setName("P900");
		fields[0].setType(DBFDataType.CHARACTER);
		fields[0].setLength(22);
		fields[1] = new DBFField();
		fields[1].setName("P6891");
		fields[1].setType(DBFDataType.CHARACTER);
		fields[1].setLength(80);
		fields[2] = new DBFField();
		fields[2].setName("P686");
		fields[2].setType(DBFDataType.CHARACTER);
		fields[2].setLength(50);
		fields[3] = new DBFField();
		fields[3].setName("P800");
		fields[3].setType(DBFDataType.CHARACTER);
		fields[3].setLength(50);
		fields[4] = new DBFField();
		fields[4].setName("P1");
		fields[4].setType(DBFDataType.CHARACTER);
		fields[4].setLength(1);
		fields[5] = new DBFField();
		fields[5].setName("P2");
		fields[5].setType(DBFDataType.NUMERIC);
		fields[5].setLength(3);
		fields[6] = new DBFField();
		fields[6].setName("P3");
		fields[6].setType(DBFDataType.CHARACTER);
		fields[6].setLength(20);
		fields[7] = new DBFField();
		fields[7].setName("P4");
		fields[7].setType(DBFDataType.CHARACTER);
		fields[7].setLength(40);
		fields[8] = new DBFField();
		fields[8].setName("P5");
		fields[8].setType(DBFDataType.CHARACTER);
		fields[8].setLength(1);
		fields[9] = new DBFField();
		fields[9].setName("P6");
		fields[9].setType(DBFDataType.DATE);
		fields[10] = new DBFField();
		fields[10].setName("P7");
		fields[10].setType(DBFDataType.NUMERIC);
		fields[10].setLength(3);
		fields[11] = new DBFField();
		fields[11].setName("P8");
		fields[11].setType(DBFDataType.CHARACTER);
		fields[11].setLength(1);
		fields[12] = new DBFField();
		fields[12].setName("P9");
		fields[12].setType(DBFDataType.CHARACTER);
		fields[12].setLength(2);
		fields[13] = new DBFField();
		fields[13].setName("P101");
		fields[13].setType(DBFDataType.CHARACTER);
		fields[13].setLength(30);
		fields[14] = new DBFField();
		fields[14].setName("P102");
		fields[14].setType(DBFDataType.CHARACTER);
		fields[14].setLength(30);
		fields[15] = new DBFField();
		fields[15].setName("P103");
		fields[15].setType(DBFDataType.CHARACTER);
		fields[15].setLength(30);
		fields[16] = new DBFField();
		fields[16].setName("P11");
		fields[16].setType(DBFDataType.CHARACTER);
		fields[16].setLength(20);
		fields[17] = new DBFField();
		fields[17].setName("P12");
		fields[17].setType(DBFDataType.CHARACTER);
		fields[17].setLength(20);
		fields[18] = new DBFField();
		fields[18].setName("P13");
		fields[18].setType(DBFDataType.CHARACTER);
		fields[18].setLength(18);
		fields[19] = new DBFField();
		fields[19].setName("P801");
		fields[19].setType(DBFDataType.CHARACTER);
		fields[19].setLength(200);
		//[end]
		//[start] 20-39
		fields[20] = new DBFField();
		fields[20].setName("P802");
		fields[20].setType(DBFDataType.CHARACTER);
		fields[20].setLength(40);
		fields[21] = new DBFField();
		fields[21].setName("P803");
		fields[21].setType(DBFDataType.CHARACTER);
		fields[21].setLength(6);
		fields[22] = new DBFField();
		fields[22].setName("P14");
		fields[22].setType(DBFDataType.CHARACTER);
		fields[22].setLength(200);
		fields[23] = new DBFField();
		fields[23].setName("P15");
		fields[23].setType(DBFDataType.CHARACTER);
		fields[23].setLength(40);
		fields[24] = new DBFField();
		fields[24].setName("P16");
		fields[24].setType(DBFDataType.CHARACTER);
		fields[24].setLength(40);
		fields[25] = new DBFField();
		fields[25].setName("P17");
		fields[25].setType(DBFDataType.CHARACTER);
		fields[25].setLength(200);
		fields[26] = new DBFField();
		fields[26].setName("P171");
		fields[26].setType(DBFDataType.CHARACTER);
		fields[26].setLength(6);
		fields[27] = new DBFField();
		fields[27].setName("P18");
		fields[27].setType(DBFDataType.CHARACTER);
		fields[27].setLength(20);
		fields[28] = new DBFField();
		fields[28].setName("P19");
		fields[28].setType(DBFDataType.CHARACTER);
		fields[28].setLength(40);
		fields[29] = new DBFField();
		fields[29].setName("P20");
		fields[29].setType(DBFDataType.CHARACTER);
		fields[29].setLength(200);
		fields[30] = new DBFField();
		fields[30].setName("P804");
		fields[30].setType(DBFDataType.CHARACTER);
		fields[30].setLength(1);
		fields[31] = new DBFField();
		fields[31].setName("P21");
		fields[31].setType(DBFDataType.CHARACTER);
		fields[31].setLength(30);
		fields[32] = new DBFField();
		fields[32].setName("P22");
		fields[32].setType(DBFDataType.DATE);
		fields[33] = new DBFField();
		fields[33].setName("P23");
		fields[33].setType(DBFDataType.CHARACTER);
		fields[33].setLength(6);
		fields[34] = new DBFField();
		fields[34].setName("P231");
		fields[34].setType(DBFDataType.CHARACTER);
		fields[34].setLength(4);
		fields[35] = new DBFField();
		fields[35].setName("P24");
		fields[35].setType(DBFDataType.CHARACTER);
		fields[35].setLength(6);
		fields[36] = new DBFField();
		fields[36].setName("P25");
		fields[36].setType(DBFDataType.DATE);
		fields[37] = new DBFField();
		fields[37].setName("P26");
		fields[37].setType(DBFDataType.CHARACTER);
		fields[37].setLength(6);
		fields[38] = new DBFField();
		fields[38].setName("P261");
		fields[38].setType(DBFDataType.CHARACTER);
		fields[38].setLength(4);
		fields[39] = new DBFField();
		fields[39].setName("P27");
		fields[39].setType(DBFDataType.NUMERIC);
		fields[39].setLength(6);
		//[end]
		//[start] 40-49
		fields[40] = new DBFField();
		fields[40].setName("P28");
		fields[40].setType(DBFDataType.CHARACTER);
		fields[40].setLength(20);
		fields[41] = new DBFField();
		fields[41].setName("P281");
		fields[41].setType(DBFDataType.CHARACTER);
		fields[41].setLength(100);
		fields[42] = new DBFField();
		fields[42].setName("P29");
		fields[42].setType(DBFDataType.CHARACTER);
		fields[42].setLength(1);
		fields[43] = new DBFField();
		fields[43].setName("P30");
		fields[43].setType(DBFDataType.CHARACTER);
		fields[43].setLength(30);
		fields[44] = new DBFField();
		fields[44].setName("P301");
		fields[44].setType(DBFDataType.CHARACTER);
		fields[44].setLength(100);
		fields[45] = new DBFField();
		fields[45].setName("P31");
		fields[45].setType(DBFDataType.DATE);
		fields[46] = new DBFField();
		fields[46].setName("P321");
		fields[46].setType(DBFDataType.CHARACTER);
		fields[46].setLength(20);
		fields[47] = new DBFField();
		fields[47].setName("P322");
		fields[47].setType(DBFDataType.CHARACTER);
		fields[47].setLength(100);
		fields[48] = new DBFField();
		fields[48].setName("P805");
		fields[48].setType(DBFDataType.CHARACTER);
		fields[48].setLength(1);
		fields[49] = new DBFField();
		fields[49].setName("P323");
		fields[49].setType(DBFDataType.CHARACTER);
		fields[49].setLength(1);
		//[end]
		//[start] 50-69
		fields[50] = new DBFField();
		fields[50].setName("P324");
		fields[50].setType(DBFDataType.CHARACTER);
		fields[50].setLength(20);
		fields[51] = new DBFField();
		fields[51].setName("P325");
		fields[51].setType(DBFDataType.CHARACTER);
		fields[51].setLength(100);
		fields[52] = new DBFField();
		fields[52].setName("P806");
		fields[52].setType(DBFDataType.CHARACTER);
		fields[52].setLength(1);
		fields[53] = new DBFField();
		fields[53].setName("P326");
		fields[53].setType(DBFDataType.CHARACTER);
		fields[53].setLength(1);
		fields[54] = new DBFField();
		fields[54].setName("P327");
		fields[54].setType(DBFDataType.CHARACTER);
		fields[54].setLength(20);
		fields[55] = new DBFField();
		fields[55].setName("P328");
		fields[55].setType(DBFDataType.CHARACTER);
		fields[55].setLength(100);
		fields[56] = new DBFField();
		fields[56].setName("P807");
		fields[56].setType(DBFDataType.CHARACTER);
		fields[56].setLength(1);
		fields[57] = new DBFField();
		fields[57].setName("P329");
		fields[57].setType(DBFDataType.CHARACTER);
		fields[57].setLength(1);

		fields[58] = new DBFField();
		fields[58].setName("P3291");
		fields[58].setType(DBFDataType.CHARACTER);
		fields[58].setLength(20);
		fields[59] = new DBFField();
		fields[59].setName("P3292");
		fields[59].setType(DBFDataType.CHARACTER);
		fields[59].setLength(100);
		fields[60] = new DBFField();
		fields[60].setName("P808");
		fields[60].setType(DBFDataType.CHARACTER);
		fields[60].setLength(1);
		fields[61] = new DBFField();
		fields[61].setName("P3293");
		fields[61].setType(DBFDataType.CHARACTER);
		fields[61].setLength(1);

		fields[62] = new DBFField();
		fields[62].setName("P3294");
		fields[62].setType(DBFDataType.CHARACTER);
		fields[62].setLength(20);
		fields[63] = new DBFField();
		fields[63].setName("P3295");
		fields[63].setType(DBFDataType.CHARACTER);
		fields[63].setLength(100);
		fields[64] = new DBFField();
		fields[64].setName("P809");
		fields[64].setType(DBFDataType.CHARACTER);
		fields[64].setLength(1);
		fields[65] = new DBFField();
		fields[65].setName("P3296");
		fields[65].setType(DBFDataType.CHARACTER);
		fields[65].setLength(1);

		fields[66] = new DBFField();
		fields[66].setName("P3297");
		fields[66].setType(DBFDataType.CHARACTER);
		fields[66].setLength(20);
		fields[67] = new DBFField();
		fields[67].setName("P3298");
		fields[67].setType(DBFDataType.CHARACTER);
		fields[67].setLength(100);
		fields[68] = new DBFField();
		fields[68].setName("P810");
		fields[68].setType(DBFDataType.CHARACTER);
		fields[68].setLength(1);
		fields[69] = new DBFField();
		fields[69].setName("P3297");
		fields[69].setType(DBFDataType.CHARACTER);
		fields[69].setLength(1);
		//[end]

		//[start] 70-89
		fields[70] = new DBFField();
		fields[70].setName("P3281");
		fields[70].setType(DBFDataType.CHARACTER);
		fields[70].setLength(20);
		fields[71] = new DBFField();
		fields[71].setName("P3282");
		fields[71].setType(DBFDataType.CHARACTER);
		fields[71].setLength(100);
		fields[72] = new DBFField();
		fields[72].setName("P811");
		fields[72].setType(DBFDataType.CHARACTER);
		fields[72].setLength(1);
		fields[73] = new DBFField();
		fields[73].setName("P3283");
		fields[73].setType(DBFDataType.CHARACTER);
		fields[73].setLength(1);

		fields[74] = new DBFField();
		fields[74].setName("P3284");
		fields[74].setType(DBFDataType.CHARACTER);
		fields[74].setLength(20);
		fields[75] = new DBFField();
		fields[75].setName("P3285");
		fields[75].setType(DBFDataType.CHARACTER);
		fields[75].setLength(100);
		fields[76] = new DBFField();
		fields[76].setName("P812");
		fields[76].setType(DBFDataType.CHARACTER);
		fields[76].setLength(1);
		fields[77] = new DBFField();
		fields[77].setName("P3286");
		fields[77].setType(DBFDataType.CHARACTER);
		fields[77].setLength(1);

		fields[78] = new DBFField();
		fields[78].setName("P3287");
		fields[78].setType(DBFDataType.CHARACTER);
		fields[78].setLength(20);
		fields[79] = new DBFField();
		fields[79].setName("P3288");
		fields[79].setType(DBFDataType.CHARACTER);
		fields[79].setLength(100);
		fields[80] = new DBFField();
		fields[80].setName("P813");
		fields[80].setType(DBFDataType.CHARACTER);
		fields[80].setLength(1);
		fields[81] = new DBFField();
		fields[81].setName("P3289");
		fields[81].setType(DBFDataType.CHARACTER);
		fields[81].setLength(1);

		fields[82] = new DBFField();
		fields[82].setName("P3271");
		fields[82].setType(DBFDataType.CHARACTER);
		fields[82].setLength(20);
		fields[83] = new DBFField();
		fields[83].setName("P3272");
		fields[83].setType(DBFDataType.CHARACTER);
		fields[83].setLength(100);
		fields[84] = new DBFField();
		fields[84].setName("P814");
		fields[84].setType(DBFDataType.CHARACTER);
		fields[84].setLength(1);
		fields[85] = new DBFField();
		fields[85].setName("P3273");
		fields[85].setType(DBFDataType.CHARACTER);
		fields[85].setLength(1);

		fields[86] = new DBFField();
		fields[86].setName("P3274");
		fields[86].setType(DBFDataType.CHARACTER);
		fields[86].setLength(20);
		fields[87] = new DBFField();
		fields[87].setName("P3275");
		fields[87].setType(DBFDataType.CHARACTER);
		fields[87].setLength(100);
		fields[88] = new DBFField();
		fields[88].setName("P815");
		fields[88].setType(DBFDataType.CHARACTER);
		fields[88].setLength(1);
		fields[89] = new DBFField();
		fields[89].setName("P3276");
		fields[89].setType(DBFDataType.CHARACTER);
		fields[89].setLength(1);
		//[end]

		//[start] 90-105
		fields[90] = new DBFField();
		fields[90].setName("P689");
		fields[90].setType(DBFDataType.NUMERIC);
		fields[90].setLength(5);

		fields[91] = new DBFField();
		fields[91].setName("P351");
		fields[91].setType(DBFDataType.CHARACTER);
		fields[91].setLength(20);
		fields[92] = new DBFField();
		fields[92].setName("P352");
		fields[92].setType(DBFDataType.CHARACTER);
		fields[92].setLength(100);
		fields[93] = new DBFField();
		fields[93].setName("P816");
		fields[93].setType(DBFDataType.CHARACTER);
		fields[93].setLength(50);

		fields[94] = new DBFField();
		fields[94].setName("P353");
		fields[94].setType(DBFDataType.CHARACTER);
		fields[94].setLength(20);
		fields[95] = new DBFField();
		fields[95].setName("P354");
		fields[95].setType(DBFDataType.CHARACTER);
		fields[95].setLength(100);
		fields[96] = new DBFField();
		fields[96].setName("P817");
		fields[96].setType(DBFDataType.CHARACTER);
		fields[96].setLength(50);

		fields[97] = new DBFField();
		fields[97].setName("P355");
		fields[97].setType(DBFDataType.CHARACTER);
		fields[97].setLength(20);
		fields[98] = new DBFField();
		fields[98].setName("P356");
		fields[98].setType(DBFDataType.CHARACTER);
		fields[98].setLength(100);
		fields[99] = new DBFField();
		fields[99].setName("P818");
		fields[99].setType(DBFDataType.CHARACTER);
		fields[99].setLength(50);

		fields[100] = new DBFField();
		fields[100].setName("P361");
		fields[100].setType(DBFDataType.CHARACTER);
		fields[100].setLength(20);
		fields[101] = new DBFField();
		fields[101].setName("P362");
		fields[101].setType(DBFDataType.CHARACTER);
		fields[101].setLength(100);

		fields[102] = new DBFField();
		fields[102].setName("P363");
		fields[102].setType(DBFDataType.CHARACTER);
		fields[102].setLength(20);
		fields[103] = new DBFField();
		fields[103].setName("P364");
		fields[103].setType(DBFDataType.CHARACTER);
		fields[103].setLength(100);

		fields[104] = new DBFField();
		fields[104].setName("P364");
		fields[104].setType(DBFDataType.CHARACTER);
		fields[104].setLength(20);
		fields[105] = new DBFField();
		fields[105].setName("P365");
		fields[105].setType(DBFDataType.CHARACTER);
		fields[105].setLength(100);
		//[end]

		//[start] 106-119
		fields[106] = new DBFField();
		fields[106].setName("P371");
		fields[106].setType(DBFDataType.CHARACTER);
		fields[106].setLength(200);
		fields[107] = new DBFField();
		fields[107].setName("P372");
		fields[107].setType(DBFDataType.CHARACTER);
		fields[107].setLength(100);
		fields[108] = new DBFField();
		fields[108].setName("P38");
		fields[108].setType(DBFDataType.CHARACTER);
		fields[108].setLength(1);
		fields[109] = new DBFField();
		fields[109].setName("P39");
		fields[109].setType(DBFDataType.CHARACTER);
		fields[109].setLength(1);
		fields[110] = new DBFField();
		fields[110].setName("P40");
		fields[110].setType(DBFDataType.CHARACTER);
		fields[110].setLength(1);

		fields[111] = new DBFField();
		fields[111].setName("P411");
		fields[111].setType(DBFDataType.CHARACTER);
		fields[111].setLength(1);
		fields[112] = new DBFField();
		fields[112].setName("P412");
		fields[112].setType(DBFDataType.CHARACTER);
		fields[112].setLength(1);
		fields[113] = new DBFField();
		fields[113].setName("P413");
		fields[113].setType(DBFDataType.CHARACTER);
		fields[113].setLength(1);
		fields[114] = new DBFField();
		fields[114].setName("P414");
		fields[114].setType(DBFDataType.CHARACTER);
		fields[114].setLength(1);
		fields[115] = new DBFField();
		fields[115].setName("P415");
		fields[115].setType(DBFDataType.CHARACTER);
		fields[115].setLength(1);

		fields[116] = new DBFField();
		fields[116].setName("P421");
		fields[116].setType(DBFDataType.NUMERIC);
		fields[116].setLength(3);
		fields[117] = new DBFField();
		fields[117].setName("P422");
		fields[117].setType(DBFDataType.NUMERIC);
		fields[117].setLength(3);

		fields[118] = new DBFField();
		fields[118].setName("P687");
		fields[118].setType(DBFDataType.CHARACTER);
		fields[118].setLength(1);
		fields[119] = new DBFField();
		fields[119].setName("P688");
		fields[119].setType(DBFDataType.CHARACTER);
		fields[119].setLength(1);

		/*fields[107] = new DBFField();
		fields[90].setName("P372");
		fields[90].setType(DBFDataType.NUMERIC);
		fields[90].setLength(5);

		fields[91] = new DBFField();
		fields[91].setName("P351");
		fields[91].setType(DBFDataType.CHARACTER);
		fields[91].setLength(20);*/
		//[end]
		//[start] 120-132
		fields[120] = new DBFField();
		fields[120].setName("P431");
		fields[120].setType(DBFDataType.CHARACTER);
		fields[120].setLength(40);
		fields[121] = new DBFField();
		fields[121].setName("P432");
		fields[121].setType(DBFDataType.CHARACTER);
		fields[121].setLength(40);
		fields[122] = new DBFField();
		fields[122].setName("P433");
		fields[122].setType(DBFDataType.CHARACTER);
		fields[122].setLength(40);
		fields[123] = new DBFField();
		fields[123].setName("P434");
		fields[123].setType(DBFDataType.CHARACTER);
		fields[123].setLength(40);
		fields[124] = new DBFField();
		fields[124].setName("P819");
		fields[124].setType(DBFDataType.CHARACTER);
		fields[124].setLength(40);
		fields[125] = new DBFField();
		fields[125].setName("P435");
		fields[125].setType(DBFDataType.CHARACTER);
		fields[125].setLength(40);
		fields[126] = new DBFField();
		fields[126].setName("P436");
		fields[126].setType(DBFDataType.CHARACTER);
		fields[126].setLength(40);
		fields[127] = new DBFField();
		fields[127].setName("P437");
		fields[127].setType(DBFDataType.CHARACTER);
		fields[127].setLength(40);
		fields[128] = new DBFField();
		fields[128].setName("P438");
		fields[128].setType(DBFDataType.CHARACTER);
		fields[128].setLength(40);
		fields[129] = new DBFField();
		fields[129].setName("P44");
		fields[129].setType(DBFDataType.CHARACTER);
		fields[129].setLength(1);
		fields[130] = new DBFField();
		fields[130].setName("P45");
		fields[130].setType(DBFDataType.CHARACTER);
		fields[130].setLength(40);
		fields[131] = new DBFField();
		fields[131].setName("P46");
		fields[131].setType(DBFDataType.CHARACTER);
		fields[131].setLength(40);
		fields[132] = new DBFField();
		fields[132].setName("P47");
		fields[132].setType(DBFDataType.DATE);
		//[end]

		//[start] 133-262
		fields[133] = new DBFField();
		fields[133].setName("P490");
		fields[133].setType(DBFDataType.CHARACTER);
		fields[133].setLength(20);
		fields[134] = new DBFField();
		fields[134].setName("P491");
		fields[134].setType(DBFDataType.DATE);
		fields[135] = new DBFField();
		fields[135].setName("P820");
		fields[135].setType(DBFDataType.CHARACTER);
		fields[135].setLength(1);
		fields[136] = new DBFField();
		fields[136].setName("P492");
		fields[136].setType(DBFDataType.CHARACTER);
		fields[136].setLength(100);
		fields[137] = new DBFField();
		fields[137].setName("P493");
		fields[137].setType(DBFDataType.CHARACTER);
		fields[137].setLength(4);
		fields[138] = new DBFField();
		fields[138].setName("P494");
		fields[138].setType(DBFDataType.NUMERIC);
		fields[138].setLength(7);
		fields[138].setDecimalCount(2);
		fields[139] = new DBFField();
		fields[139].setName("P495");
		fields[139].setType(DBFDataType.CHARACTER);
		fields[139].setLength(40);
		fields[140] = new DBFField();
		fields[140].setName("P496");
		fields[140].setType(DBFDataType.CHARACTER);
		fields[140].setLength(40);
		fields[141] = new DBFField();
		fields[141].setName("P497");
		fields[141].setType(DBFDataType.CHARACTER);
		fields[141].setLength(40);
		fields[142] = new DBFField();
		fields[142].setName("P498");
		fields[142].setType(DBFDataType.CHARACTER);
		fields[142].setLength(6);
		fields[143] = new DBFField();
		fields[143].setName("P4981");
		fields[143].setType(DBFDataType.CHARACTER);
		fields[143].setLength(1);
		fields[144] = new DBFField();
		fields[144].setName("P499");
		fields[144].setType(DBFDataType.CHARACTER);
		fields[144].setLength(2);
		fields[145] = new DBFField();
		fields[145].setName("P4910");
		fields[145].setType(DBFDataType.CHARACTER);
		fields[145].setLength(40);

		fields[146] = new DBFField();
		fields[146].setName("P4911");
		fields[146].setType(DBFDataType.CHARACTER);
		fields[146].setLength(20);
		fields[147] = new DBFField();
		fields[147].setName("P4912");
		fields[147].setType(DBFDataType.DATE);
		fields[148] = new DBFField();
		fields[148].setName("P821");
		fields[148].setType(DBFDataType.CHARACTER);
		fields[148].setLength(1);
		fields[149] = new DBFField();
		fields[149].setName("P4913");
		fields[149].setType(DBFDataType.CHARACTER);
		fields[149].setLength(100);
		fields[150] = new DBFField();
		fields[150].setName("P4914");
		fields[150].setType(DBFDataType.CHARACTER);
		fields[150].setLength(4);
		fields[151] = new DBFField();
		fields[151].setName("P4915");
		fields[151].setType(DBFDataType.NUMERIC);
		fields[151].setLength(7);
		fields[151].setDecimalCount(2);
		fields[152] = new DBFField();
		fields[152].setName("P4916");
		fields[152].setType(DBFDataType.CHARACTER);
		fields[152].setLength(40);
		fields[153] = new DBFField();
		fields[153].setName("P4917");
		fields[153].setType(DBFDataType.CHARACTER);
		fields[153].setLength(40);
		fields[154] = new DBFField();
		fields[154].setName("P4918");
		fields[154].setType(DBFDataType.CHARACTER);
		fields[154].setLength(40);
		fields[155] = new DBFField();
		fields[155].setName("P4919");
		fields[155].setType(DBFDataType.CHARACTER);
		fields[155].setLength(6);
		fields[156] = new DBFField();
		fields[156].setName("P4982");
		fields[156].setType(DBFDataType.CHARACTER);
		fields[156].setLength(1);
		fields[157] = new DBFField();
		fields[157].setName("P4920");
		fields[157].setType(DBFDataType.CHARACTER);
		fields[157].setLength(2);
		fields[158] = new DBFField();
		fields[158].setName("P4921");
		fields[158].setType(DBFDataType.CHARACTER);
		fields[158].setLength(40);

		fields[159] = new DBFField();
		fields[159].setName("P4922");
		fields[159].setType(DBFDataType.CHARACTER);
		fields[159].setLength(40);
		fields[160] = new DBFField();
		fields[160].setName("P4923");
		fields[160].setType(DBFDataType.DATE);
		fields[161] = new DBFField();
		fields[161].setName("P822");
		fields[161].setType(DBFDataType.CHARACTER);
		fields[161].setLength(1);
		fields[162] = new DBFField();
		fields[162].setName("P4924");
		fields[162].setType(DBFDataType.CHARACTER);
		fields[162].setLength(100);
		fields[163] = new DBFField();
		fields[163].setName("P4925");
		fields[163].setType(DBFDataType.CHARACTER);
		fields[163].setLength(4);
		fields[164] = new DBFField();
		fields[164].setName("P4526");
		fields[164].setType(DBFDataType.NUMERIC);
		fields[164].setLength(7);
		fields[164].setDecimalCount(2);
		fields[165] = new DBFField();
		fields[165].setName("P4527");
		fields[165].setType(DBFDataType.CHARACTER);
		fields[165].setLength(40);
		fields[166] = new DBFField();
		fields[166].setName("P4528");
		fields[166].setType(DBFDataType.CHARACTER);
		fields[166].setLength(40);
		fields[167] = new DBFField();
		fields[167].setName("P4529");
		fields[167].setType(DBFDataType.CHARACTER);
		fields[167].setLength(40);
		fields[168] = new DBFField();
		fields[168].setName("P4530");
		fields[168].setType(DBFDataType.CHARACTER);
		fields[168].setLength(6);
		fields[169] = new DBFField();
		fields[169].setName("P4983");
		fields[169].setType(DBFDataType.CHARACTER);
		fields[169].setLength(1);
		fields[170] = new DBFField();
		fields[170].setName("P4531");
		fields[170].setType(DBFDataType.CHARACTER);
		fields[170].setLength(2);
		fields[171] = new DBFField();
		fields[171].setName("P4532");
		fields[171].setType(DBFDataType.CHARACTER);
		fields[171].setLength(40);

		fields[172] = new DBFField();
		fields[172].setName("P4533");
		fields[172].setType(DBFDataType.CHARACTER);
		fields[172].setLength(20);
		fields[173] = new DBFField();
		fields[173].setName("P4534");
		fields[173].setType(DBFDataType.DATE);
		fields[174] = new DBFField();
		fields[174].setName("P823");
		fields[174].setType(DBFDataType.CHARACTER);
		fields[174].setLength(1);
		fields[175] = new DBFField();
		fields[175].setName("P4535");
		fields[175].setType(DBFDataType.CHARACTER);
		fields[175].setLength(100);
		fields[176] = new DBFField();
		fields[176].setName("P4536");
		fields[176].setType(DBFDataType.CHARACTER);
		fields[176].setLength(4);
		fields[177] = new DBFField();
		fields[177].setName("P4537");
		fields[177].setType(DBFDataType.NUMERIC);
		fields[177].setLength(7);
		fields[177].setDecimalCount(2);
		fields[178] = new DBFField();
		fields[178].setName("P4538");
		fields[178].setType(DBFDataType.CHARACTER);
		fields[178].setLength(40);
		fields[179] = new DBFField();
		fields[179].setName("P4539");
		fields[179].setType(DBFDataType.CHARACTER);
		fields[179].setLength(40);
		fields[180] = new DBFField();
		fields[180].setName("P4540");
		fields[180].setType(DBFDataType.CHARACTER);
		fields[180].setLength(40);
		fields[181] = new DBFField();
		fields[181].setName("P4541");
		fields[181].setType(DBFDataType.CHARACTER);
		fields[181].setLength(6);
		fields[182] = new DBFField();
		fields[182].setName("P4984");
		fields[182].setType(DBFDataType.CHARACTER);
		fields[182].setLength(1);
		fields[183] = new DBFField();
		fields[183].setName("P4542");
		fields[183].setType(DBFDataType.CHARACTER);
		fields[183].setLength(2);
		fields[184] = new DBFField();
		fields[184].setName("P4543");
		fields[184].setType(DBFDataType.CHARACTER);
		fields[184].setLength(40);

		fields[185] = new DBFField();
		fields[185].setName("P4544");
		fields[185].setType(DBFDataType.CHARACTER);
		fields[185].setLength(20);
		fields[186] = new DBFField();
		fields[186].setName("P4545");
		fields[186].setType(DBFDataType.DATE);
		fields[187] = new DBFField();
		fields[187].setName("P824");
		fields[187].setType(DBFDataType.CHARACTER);
		fields[187].setLength(1);
		fields[188] = new DBFField();
		fields[188].setName("P4546");
		fields[188].setType(DBFDataType.CHARACTER);
		fields[188].setLength(100);
		fields[189] = new DBFField();
		fields[189].setName("P4547");
		fields[189].setType(DBFDataType.CHARACTER);
		fields[189].setLength(4);
		fields[190] = new DBFField();
		fields[190].setName("P4548");
		fields[190].setType(DBFDataType.NUMERIC);
		fields[190].setLength(7);
		fields[190].setDecimalCount(2);
		fields[191] = new DBFField();
		fields[191].setName("P4549");
		fields[191].setType(DBFDataType.CHARACTER);
		fields[191].setLength(40);
		fields[192] = new DBFField();
		fields[192].setName("P4550");
		fields[192].setType(DBFDataType.CHARACTER);
		fields[192].setLength(40);
		fields[193] = new DBFField();
		fields[193].setName("P4551");
		fields[193].setType(DBFDataType.CHARACTER);
		fields[193].setLength(40);
		fields[194] = new DBFField();
		fields[194].setName("P4552");
		fields[194].setType(DBFDataType.CHARACTER);
		fields[194].setLength(6);
		fields[195] = new DBFField();
		fields[195].setName("P4985");
		fields[195].setType(DBFDataType.CHARACTER);
		fields[195].setLength(1);
		fields[196] = new DBFField();
		fields[196].setName("P4553");
		fields[196].setType(DBFDataType.CHARACTER);
		fields[196].setLength(2);
		fields[197] = new DBFField();
		fields[197].setName("P4554");
		fields[197].setType(DBFDataType.CHARACTER);
		fields[197].setLength(40);

		fields[198] = new DBFField();
		fields[198].setName("P45002");
		fields[198].setType(DBFDataType.CHARACTER);
		fields[198].setLength(20);
		fields[199] = new DBFField();
		fields[199].setName("P45003");
		fields[199].setType(DBFDataType.DATE);
		fields[200] = new DBFField();
		fields[200].setName("P825");
		fields[200].setType(DBFDataType.CHARACTER);
		fields[200].setLength(1);
		fields[201] = new DBFField();
		fields[201].setName("P45004");
		fields[201].setType(DBFDataType.CHARACTER);
		fields[201].setLength(100);
		fields[202] = new DBFField();
		fields[202].setName("P45005");
		fields[202].setType(DBFDataType.CHARACTER);
		fields[202].setLength(4);
		fields[203] = new DBFField();
		fields[203].setName("P45006");
		fields[203].setType(DBFDataType.NUMERIC);
		fields[203].setLength(7);
		fields[203].setDecimalCount(2);
		fields[204] = new DBFField();
		fields[204].setName("P45007");
		fields[204].setType(DBFDataType.CHARACTER);
		fields[204].setLength(40);
		fields[205] = new DBFField();
		fields[205].setName("P45008");
		fields[205].setType(DBFDataType.CHARACTER);
		fields[205].setLength(40);
		fields[206] = new DBFField();
		fields[206].setName("P45009");
		fields[206].setType(DBFDataType.CHARACTER);
		fields[206].setLength(40);
		fields[207] = new DBFField();
		fields[207].setName("P45010");
		fields[207].setType(DBFDataType.CHARACTER);
		fields[207].setLength(6);
		fields[208] = new DBFField();
		fields[208].setName("P45011");
		fields[208].setType(DBFDataType.CHARACTER);
		fields[208].setLength(1);
		fields[209] = new DBFField();
		fields[209].setName("P45012");
		fields[209].setType(DBFDataType.CHARACTER);
		fields[209].setLength(2);
		fields[210] = new DBFField();
		fields[210].setName("P45013");
		fields[210].setType(DBFDataType.CHARACTER);
		fields[210].setLength(40);

		fields[211] = new DBFField();
		fields[211].setName("P45014");
		fields[211].setType(DBFDataType.CHARACTER);
		fields[211].setLength(20);
		fields[212] = new DBFField();
		fields[212].setName("P45015");
		fields[212].setType(DBFDataType.DATE);
		fields[213] = new DBFField();
		fields[213].setName("P826");
		fields[213].setType(DBFDataType.CHARACTER);
		fields[213].setLength(1);
		fields[214] = new DBFField();
		fields[214].setName("P45016");
		fields[214].setType(DBFDataType.CHARACTER);
		fields[214].setLength(100);
		fields[215] = new DBFField();
		fields[215].setName("P45017");
		fields[215].setType(DBFDataType.CHARACTER);
		fields[215].setLength(4);
		fields[216] = new DBFField();
		fields[216].setName("P45018");
		fields[216].setType(DBFDataType.NUMERIC);
		fields[216].setLength(7);
		fields[216].setDecimalCount(2);
		fields[217] = new DBFField();
		fields[217].setName("P45019");
		fields[217].setType(DBFDataType.CHARACTER);
		fields[217].setLength(40);
		fields[218] = new DBFField();
		fields[218].setName("P45020");
		fields[218].setType(DBFDataType.CHARACTER);
		fields[218].setLength(40);
		fields[219] = new DBFField();
		fields[219].setName("P45021");
		fields[219].setType(DBFDataType.CHARACTER);
		fields[219].setLength(40);
		fields[220] = new DBFField();
		fields[220].setName("P45022");
		fields[220].setType(DBFDataType.CHARACTER);
		fields[220].setLength(6);
		fields[221] = new DBFField();
		fields[221].setName("P45023");
		fields[221].setType(DBFDataType.CHARACTER);
		fields[221].setLength(1);
		fields[222] = new DBFField();
		fields[222].setName("P45024");
		fields[222].setType(DBFDataType.CHARACTER);
		fields[222].setLength(2);
		fields[223] = new DBFField();
		fields[223].setName("P45025");
		fields[223].setType(DBFDataType.CHARACTER);
		fields[223].setLength(40);

		fields[224] = new DBFField();
		fields[224].setName("P45026");
		fields[224].setType(DBFDataType.CHARACTER);
		fields[224].setLength(20);
		fields[225] = new DBFField();
		fields[225].setName("P45027");
		fields[225].setType(DBFDataType.DATE);
		fields[226] = new DBFField();
		fields[226].setName("P827");
		fields[226].setType(DBFDataType.CHARACTER);
		fields[226].setLength(1);
		fields[227] = new DBFField();
		fields[227].setName("P45028");
		fields[227].setType(DBFDataType.CHARACTER);
		fields[227].setLength(100);
		fields[228] = new DBFField();
		fields[228].setName("P45029");
		fields[228].setType(DBFDataType.CHARACTER);
		fields[228].setLength(4);
		fields[229] = new DBFField();
		fields[229].setName("P45030");
		fields[229].setType(DBFDataType.NUMERIC);
		fields[229].setLength(7);
		fields[229].setDecimalCount(2);
		fields[230] = new DBFField();
		fields[230].setName("P45031");
		fields[230].setType(DBFDataType.CHARACTER);
		fields[230].setLength(40);
		fields[231] = new DBFField();
		fields[231].setName("P45032");
		fields[231].setType(DBFDataType.CHARACTER);
		fields[231].setLength(40);
		fields[232] = new DBFField();
		fields[232].setName("P45033");
		fields[232].setType(DBFDataType.CHARACTER);
		fields[232].setLength(40);
		fields[233] = new DBFField();
		fields[233].setName("P45034");
		fields[233].setType(DBFDataType.CHARACTER);
		fields[233].setLength(6);
		fields[234] = new DBFField();
		fields[234].setName("P45035");
		fields[234].setType(DBFDataType.CHARACTER);
		fields[234].setLength(1);
		fields[235] = new DBFField();
		fields[235].setName("P45036");
		fields[235].setType(DBFDataType.CHARACTER);
		fields[235].setLength(2);
		fields[236] = new DBFField();
		fields[236].setName("P45037");
		fields[236].setType(DBFDataType.CHARACTER);
		fields[236].setLength(40);

		fields[237] = new DBFField();
		fields[237].setName("P45038");
		fields[237].setType(DBFDataType.CHARACTER);
		fields[237].setLength(20);
		fields[238] = new DBFField();
		fields[238].setName("P45039");
		fields[238].setType(DBFDataType.DATE);
		fields[239] = new DBFField();
		fields[239].setName("P828");
		fields[239].setType(DBFDataType.CHARACTER);
		fields[239].setLength(1);
		fields[240] = new DBFField();
		fields[240].setName("P45040");
		fields[240].setType(DBFDataType.CHARACTER);
		fields[240].setLength(100);
		fields[241] = new DBFField();
		fields[241].setName("P45041");
		fields[241].setType(DBFDataType.CHARACTER);
		fields[241].setLength(4);
		fields[242] = new DBFField();
		fields[242].setName("P45042");
		fields[242].setType(DBFDataType.NUMERIC);
		fields[242].setLength(7);
		fields[242].setDecimalCount(2);
		fields[243] = new DBFField();
		fields[243].setName("P45043");
		fields[243].setType(DBFDataType.CHARACTER);
		fields[243].setLength(40);
		fields[244] = new DBFField();
		fields[244].setName("P45044");
		fields[244].setType(DBFDataType.CHARACTER);
		fields[244].setLength(40);
		fields[245] = new DBFField();
		fields[245].setName("P45045");
		fields[245].setType(DBFDataType.CHARACTER);
		fields[245].setLength(40);
		fields[246] = new DBFField();
		fields[246].setName("P45046");
		fields[246].setType(DBFDataType.CHARACTER);
		fields[246].setLength(6);
		fields[247] = new DBFField();
		fields[247].setName("P45047");
		fields[247].setType(DBFDataType.CHARACTER);
		fields[247].setLength(1);
		fields[248] = new DBFField();
		fields[248].setName("P45048");
		fields[248].setType(DBFDataType.CHARACTER);
		fields[248].setLength(2);
		fields[249] = new DBFField();
		fields[249].setName("P45049");
		fields[249].setType(DBFDataType.CHARACTER);
		fields[249].setLength(40);

		fields[250] = new DBFField();
		fields[250].setName("P45050");
		fields[250].setType(DBFDataType.CHARACTER);
		fields[250].setLength(20);
		fields[251] = new DBFField();
		fields[251].setName("P45051");
		fields[251].setType(DBFDataType.DATE);
		fields[252] = new DBFField();
		fields[252].setName("P829");
		fields[252].setType(DBFDataType.CHARACTER);
		fields[252].setLength(1);
		fields[253] = new DBFField();
		fields[253].setName("P45052");
		fields[253].setType(DBFDataType.CHARACTER);
		fields[253].setLength(100);
		fields[254] = new DBFField();
		fields[254].setName("P45053");
		fields[254].setType(DBFDataType.CHARACTER);
		fields[254].setLength(4);
		fields[255] = new DBFField();
		fields[255].setName("P45054");
		fields[255].setType(DBFDataType.NUMERIC);
		fields[255].setLength(7);
		fields[255].setDecimalCount(2);
		fields[256] = new DBFField();
		fields[256].setName("P45055");
		fields[256].setType(DBFDataType.CHARACTER);
		fields[256].setLength(40);
		fields[257] = new DBFField();
		fields[257].setName("P45056");
		fields[257].setType(DBFDataType.CHARACTER);
		fields[257].setLength(40);
		fields[258] = new DBFField();
		fields[258].setName("P45057");
		fields[258].setType(DBFDataType.CHARACTER);
		fields[258].setLength(40);
		fields[259] = new DBFField();
		fields[259].setName("P45058");
		fields[259].setType(DBFDataType.CHARACTER);
		fields[259].setLength(6);
		fields[260] = new DBFField();
		fields[260].setName("P45059");
		fields[260].setType(DBFDataType.CHARACTER);
		fields[260].setLength(1);
		fields[261] = new DBFField();
		fields[261].setName("P45060");
		fields[261].setType(DBFDataType.CHARACTER);
		fields[261].setLength(2);
		fields[262] = new DBFField();
		fields[262].setName("P45061");
		fields[262].setType(DBFDataType.CHARACTER);
		fields[262].setLength(40);
		//[end]

		//[start] 263-298
		fields[263] = new DBFField();
		fields[263].setName("P561");
		fields[263].setType(DBFDataType.NUMERIC);
		fields[263].setLength(6);
		fields[264] = new DBFField();
		fields[264].setName("P562");
		fields[264].setType(DBFDataType.NUMERIC);
		fields[264].setLength(6);
		fields[265] = new DBFField();
		fields[265].setName("P563");
		fields[265].setType(DBFDataType.NUMERIC);
		fields[265].setLength(6);
		fields[266] = new DBFField();
		fields[266].setName("P564");
		fields[266].setType(DBFDataType.NUMERIC);
		fields[266].setLength(6);

		fields[267] = new DBFField();
		fields[267].setName("P6911");
		fields[267].setType(DBFDataType.CHARACTER);
		fields[267].setLength(4);
		fields[268] = new DBFField();
		fields[268].setName("P6912");
		fields[268].setType(DBFDataType.DATE);
		fields[269] = new DBFField();
		fields[269].setName("P6913");
		fields[269].setType(DBFDataType.DATE);

		fields[270] = new DBFField();
		fields[270].setName("P6914");
		fields[270].setType(DBFDataType.CHARACTER);
		fields[270].setLength(4);
		fields[271] = new DBFField();
		fields[271].setName("P6915");
		fields[271].setType(DBFDataType.DATE);
		fields[272] = new DBFField();
		fields[272].setName("P6916");
		fields[272].setType(DBFDataType.DATE);

		fields[273] = new DBFField();
		fields[273].setName("P6917");
		fields[273].setType(DBFDataType.CHARACTER);
		fields[273].setLength(4);
		fields[274] = new DBFField();
		fields[274].setName("P6918");
		fields[274].setType(DBFDataType.DATE);
		fields[275] = new DBFField();
		fields[275].setName("P6919");
		fields[275].setType(DBFDataType.DATE);

		fields[276] = new DBFField();
		fields[276].setName("P6920");
		fields[276].setType(DBFDataType.CHARACTER);
		fields[276].setLength(4);
		fields[277] = new DBFField();
		fields[277].setName("P6921");
		fields[277].setType(DBFDataType.DATE);
		fields[278] = new DBFField();
		fields[278].setName("P6922");
		fields[278].setType(DBFDataType.DATE);

		fields[279] = new DBFField();
		fields[279].setName("P6923");
		fields[279].setType(DBFDataType.CHARACTER);
		fields[279].setLength(4);
		fields[280] = new DBFField();
		fields[280].setName("P6924");
		fields[280].setType(DBFDataType.DATE);
		fields[281] = new DBFField();
		fields[281].setName("P6925");
		fields[281].setType(DBFDataType.DATE);

		fields[282] = new DBFField();
		fields[282].setName("P57");
		fields[282].setType(DBFDataType.CHARACTER);
		fields[282].setLength(1);
		fields[283] = new DBFField();
		fields[283].setName("P58");
		fields[283].setType(DBFDataType.CHARACTER);
		fields[283].setLength(1);
		fields[284] = new DBFField();
		fields[284].setName("P581");
		fields[284].setType(DBFDataType.CHARACTER);
		fields[284].setLength(100);
		fields[285] = new DBFField();
		fields[285].setName("P60");
		fields[285].setType(DBFDataType.CHARACTER);
		fields[285].setLength(1);
		fields[286] = new DBFField();
		fields[286].setName("P611");
		fields[286].setType(DBFDataType.NUMERIC);
		fields[286].setLength(4);
		fields[286].setDecimalCount(2);
		fields[287] = new DBFField();
		fields[287].setName("P612");
		fields[287].setType(DBFDataType.NUMERIC);
		fields[287].setLength(4);
		fields[287].setDecimalCount(2);
		fields[288] = new DBFField();
		fields[288].setName("P613");
		fields[288].setType(DBFDataType.NUMERIC);
		fields[288].setLength(4);
		fields[288].setDecimalCount(2);
		fields[289] = new DBFField();
		fields[289].setName("P59");
		fields[289].setType(DBFDataType.CHARACTER);
		fields[289].setLength(1);
		fields[290] = new DBFField();
		fields[290].setName("P62");
		fields[290].setType(DBFDataType.CHARACTER);
		fields[290].setLength(1);
		fields[291] = new DBFField();
		fields[291].setName("P63");
		fields[291].setType(DBFDataType.CHARACTER);
		fields[291].setLength(1);
		fields[292] = new DBFField();
		fields[292].setName("P64");
		fields[292].setType(DBFDataType.CHARACTER);
		fields[292].setLength(1);

		fields[293] = new DBFField();
		fields[293].setName("P651");
		fields[293].setType(DBFDataType.NUMERIC);
		fields[293].setLength(8);
		fields[293].setDecimalCount(2);
		fields[294] = new DBFField();
		fields[294].setName("P652");
		fields[294].setType(DBFDataType.NUMERIC);
		fields[294].setLength(8);
		fields[294].setDecimalCount(2);
		fields[295] = new DBFField();
		fields[295].setName("P653");
		fields[295].setType(DBFDataType.NUMERIC);
		fields[295].setLength(6);
		fields[296] = new DBFField();
		fields[296].setName("P654");
		fields[296].setType(DBFDataType.NUMERIC);
		fields[296].setLength(6);
		fields[297] = new DBFField();
		fields[297].setName("P655");
		fields[297].setType(DBFDataType.NUMERIC);
		fields[297].setLength(6);
		fields[298] = new DBFField();
		fields[298].setName("P656");
		fields[298].setType(DBFDataType.NUMERIC);
		fields[298].setLength(6);
		//[end]
		//[start] 299-315
		fields[299] = new DBFField();
		fields[299].setName("P66");
		fields[299].setType(DBFDataType.NUMERIC);
		fields[299].setLength(4);
		fields[299].setDecimalCount(2);

		fields[300] = new DBFField();
		fields[300].setName("P681");
		fields[300].setType(DBFDataType.NUMERIC);
		fields[300].setLength(6);
		fields[301] = new DBFField();
		fields[301].setName("P682");
		fields[301].setType(DBFDataType.NUMERIC);
		fields[301].setLength(6);
		fields[302] = new DBFField();
		fields[302].setName("P683");
		fields[302].setType(DBFDataType.NUMERIC);
		fields[302].setLength(6);
		fields[303] = new DBFField();
		fields[303].setName("P684");
		fields[303].setType(DBFDataType.NUMERIC);
		fields[303].setLength(6);
		fields[304] = new DBFField();
		fields[304].setName("P685");
		fields[304].setType(DBFDataType.NUMERIC);
		fields[304].setLength(6);
		fields[305] = new DBFField();
		fields[305].setName("P67");
		fields[305].setType(DBFDataType.NUMERIC);
		fields[305].setLength(6);
		fields[306] = new DBFField();
		fields[306].setName("P731");
		fields[306].setType(DBFDataType.NUMERIC);
		fields[306].setLength(6);
		fields[307] = new DBFField();
		fields[307].setName("P732");
		fields[307].setType(DBFDataType.NUMERIC);
		fields[307].setLength(2);
		fields[308] = new DBFField();
		fields[308].setName("P733");
		fields[308].setType(DBFDataType.NUMERIC);
		fields[308].setLength(6);
		fields[309] = new DBFField();
		fields[309].setName("P734");
		fields[309].setType(DBFDataType.NUMERIC);
		fields[309].setLength(2);
		fields[310] = new DBFField();
		fields[310].setName("P72");
		fields[310].setType(DBFDataType.NUMERIC);
		fields[310].setLength(6);
		fields[311] = new DBFField();
		fields[311].setName("P830");
		fields[311].setType(DBFDataType.CHARACTER);
		fields[311].setLength(1);
		fields[312] = new DBFField();
		fields[312].setName("P831");
		fields[312].setType(DBFDataType.CHARACTER);
		fields[312].setLength(100);
		fields[313] = new DBFField();
		fields[313].setName("P741");
		fields[313].setType(DBFDataType.CHARACTER);
		fields[313].setLength(1);
		fields[314] = new DBFField();
		fields[314].setName("P742");
		fields[314].setType(DBFDataType.CHARACTER);
		fields[314].setLength(100);
		fields[315] = new DBFField();
		fields[315].setName("P743");
		fields[315].setType(DBFDataType.CHARACTER);
		fields[315].setLength(100);
		//[end]

		//[start] 316-345
		fields[316] = new DBFField();
		fields[316].setName("P782");
		fields[316].setType(DBFDataType.NUMERIC);
		fields[316].setLength(10);
		fields[316].setDecimalCount(2);
		fields[317] = new DBFField();
		fields[317].setName("P751");
		fields[317].setType(DBFDataType.NUMERIC);
		fields[317].setLength(10);
		fields[317].setDecimalCount(2);
		fields[318] = new DBFField();
		fields[318].setName("P752");
		fields[318].setType(DBFDataType.NUMERIC);
		fields[318].setLength(10);
		fields[318].setDecimalCount(2);
		fields[319] = new DBFField();
		fields[319].setName("P754");
		fields[319].setType(DBFDataType.NUMERIC);
		fields[319].setLength(10);
		fields[319].setDecimalCount(2);
		fields[320] = new DBFField();
		fields[320].setName("P755");
		fields[320].setType(DBFDataType.NUMERIC);
		fields[320].setLength(10);
		fields[320].setDecimalCount(2);
		fields[321] = new DBFField();
		fields[321].setName("P756");
		fields[321].setType(DBFDataType.NUMERIC);
		fields[321].setLength(10);
		fields[321].setDecimalCount(2);
		fields[322] = new DBFField();
		fields[322].setName("P757");
		fields[322].setType(DBFDataType.NUMERIC);
		fields[322].setLength(10);
		fields[322].setDecimalCount(2);
		fields[323] = new DBFField();
		fields[323].setName("P758");
		fields[323].setType(DBFDataType.NUMERIC);
		fields[323].setLength(10);
		fields[323].setDecimalCount(2);
		fields[324] = new DBFField();
		fields[324].setName("P759");
		fields[324].setType(DBFDataType.NUMERIC);
		fields[324].setLength(10);
		fields[324].setDecimalCount(2);
		fields[325] = new DBFField();
		fields[325].setName("P760");
		fields[325].setType(DBFDataType.NUMERIC);
		fields[325].setLength(10);
		fields[325].setDecimalCount(2);
		fields[326] = new DBFField();
		fields[326].setName("P761");
		fields[326].setType(DBFDataType.NUMERIC);
		fields[326].setLength(10);
		fields[326].setDecimalCount(2);
		fields[327] = new DBFField();
		fields[327].setName("P762");
		fields[327].setType(DBFDataType.NUMERIC);
		fields[327].setLength(10);
		fields[327].setDecimalCount(2);
		fields[328] = new DBFField();
		fields[328].setName("P763");
		fields[328].setType(DBFDataType.NUMERIC);
		fields[328].setLength(10);
		fields[328].setDecimalCount(2);
		fields[329] = new DBFField();
		fields[329].setName("P764");
		fields[329].setType(DBFDataType.NUMERIC);
		fields[329].setLength(10);
		fields[329].setDecimalCount(2);
		fields[330] = new DBFField();
		fields[330].setName("P765");
		fields[330].setType(DBFDataType.NUMERIC);
		fields[330].setLength(10);
		fields[330].setDecimalCount(2);
		fields[331] = new DBFField();
		fields[331].setName("P767");
		fields[331].setType(DBFDataType.NUMERIC);
		fields[331].setLength(10);
		fields[331].setDecimalCount(2);
		fields[332] = new DBFField();
		fields[332].setName("P768");
		fields[332].setType(DBFDataType.NUMERIC);
		fields[332].setLength(10);
		fields[332].setDecimalCount(2);
		fields[333] = new DBFField();
		fields[333].setName("P769");
		fields[333].setType(DBFDataType.NUMERIC);
		fields[333].setLength(10);
		fields[333].setDecimalCount(2);
		fields[334] = new DBFField();
		fields[334].setName("P770");
		fields[334].setType(DBFDataType.NUMERIC);
		fields[334].setLength(10);
		fields[334].setDecimalCount(2);
		fields[335] = new DBFField();
		fields[335].setName("P771");
		fields[335].setType(DBFDataType.NUMERIC);
		fields[335].setLength(10);
		fields[335].setDecimalCount(2);
		fields[336] = new DBFField();
		fields[336].setName("P772");
		fields[336].setType(DBFDataType.NUMERIC);
		fields[336].setLength(10);
		fields[336].setDecimalCount(2);
		fields[337] = new DBFField();
		fields[337].setName("P773");
		fields[337].setType(DBFDataType.NUMERIC);
		fields[337].setLength(10);
		fields[337].setDecimalCount(2);
		fields[338] = new DBFField();
		fields[338].setName("P774");
		fields[338].setType(DBFDataType.NUMERIC);
		fields[338].setLength(10);
		fields[338].setDecimalCount(2);
		fields[339] = new DBFField();
		fields[339].setName("P775");
		fields[339].setType(DBFDataType.NUMERIC);
		fields[339].setLength(10);
		fields[339].setDecimalCount(2);
		fields[340] = new DBFField();
		fields[340].setName("P776");
		fields[340].setType(DBFDataType.NUMERIC);
		fields[340].setLength(10);
		fields[340].setDecimalCount(2);
		fields[341] = new DBFField();
		fields[341].setName("P777");
		fields[341].setType(DBFDataType.NUMERIC);
		fields[341].setLength(10);
		fields[341].setDecimalCount(2);
		fields[342] = new DBFField();
		fields[342].setName("P778");
		fields[342].setType(DBFDataType.NUMERIC);
		fields[342].setLength(10);
		fields[342].setDecimalCount(2);
		fields[343] = new DBFField();
		fields[343].setName("P779");
		fields[343].setType(DBFDataType.NUMERIC);
		fields[343].setLength(10);
		fields[343].setDecimalCount(2);
		fields[344] = new DBFField();
		fields[344].setName("P780");
		fields[344].setType(DBFDataType.NUMERIC);
		fields[344].setLength(10);
		fields[344].setDecimalCount(2);
		fields[345] = new DBFField();
		fields[345].setName("P781");
		fields[345].setType(DBFDataType.NUMERIC);
		fields[345].setLength(10);
		fields[345].setDecimalCount(2);
		//[end]
		return fields;
	}


	private static void addRecordOfPageIndexHQMS(DBFWriter writer,List<Map<String, Object>> datas,int fieldLenth){
		String hospitalCode = "49417303-1";
		String hospitalName = "曲阜人民医院";
		for (Map<String, Object> data : datas) {
			/*@SuppressWarnings("unchecked")
			Map<String, Object> jsonMap = (Map<String, Object>)data.get("jsonMap");*/
			Map<String, Object> jsonMap = data;
			if(jsonMap != null){
				Object[] rowData = new Object[fieldLenth];
				Map<String, Object> basicInfo = (Map<String, Object>)jsonMap.get("basicInfo");
				Map<String, Object> cureInfo = (Map<String, Object>)jsonMap.get("cureInfo");
				Map<String, Object> operateInfo = (Map<String, Object>)jsonMap.get("hqmsOperateInfo");
				Map<String, Object> nurseInfo = (Map<String, Object>)jsonMap.get("nurseInfo");
				Map<String, Object> intensiveCareInfo = (Map<String, Object>)jsonMap.get("intensiveCareInfo");
				Map<String, Object> costInfo = (Map<String, Object>)jsonMap.get("costInfo");

				//[start] 0-19
				rowData[0] = hospitalCode;
				rowData[1] = hospitalName;
				Object medicalInsuranceNumber = basicInfo.get("medicalInsuranceNumber");
				rowData[2] = getStringValue(medicalInsuranceNumber);
				Object medicalHealthNumber = basicInfo.get("medicalHealthNumber");
				rowData[3] = getStringValue(medicalHealthNumber);
				Object medicalPayTypeCodeObj = basicInfo.get("medicalPayTypeCode");
				String medicalPayTypeCode = (String)getStringValue(medicalPayTypeCodeObj);
				if(medicalPayTypeCode != null){
					rowData[4] = medicalPayTypeCode.substring(medicalPayTypeCode.length()-1, medicalPayTypeCode.length());
				}

				Object visitNumber = basicInfo.get("visitNumber");
				rowData[5] = getIntegerValue(visitNumber);
				Object mrId = basicInfo.get("mrId");
				rowData[6] = getStringValue(mrId);
				Object patientName = basicInfo.get("patientName");
				rowData[7] = getStringValue(patientName);
				Object sexCode = basicInfo.get("sexCode");
				rowData[8] = getStringValue(sexCode);
				Object birthday = basicInfo.get("birthday");
				rowData[9] = getDateToDay(birthday);
				Object yearOfAge = basicInfo.get("yearOfAge");
				rowData[10] =getIntegerValue(yearOfAge);
				Object marriageCode = basicInfo.get("marriageCode");
				rowData[11] = getStringValue(marriageCode);
				Object professionCode = basicInfo.get("professionCode");
				rowData[12] = getStringValue(professionCode);
				Map<String, Object> birthRegionalism =(Map<String, Object>)basicInfo.get("birthRegionalism");
				if(birthRegionalism != null){
					Object provinceName = birthRegionalism.get("provinceName");
					rowData[13] = getStringValue(provinceName);
					Object cityName = birthRegionalism.get("cityName");
					rowData[14] = getStringValue(cityName);
					Object countyName = birthRegionalism.get("countyName");
					rowData[15] = getStringValue(countyName);
				}

				Object nationName = basicInfo.get("nationName");
				rowData[16] = getStringValue(nationName);
				Object nationalityName = basicInfo.get("nationalityName");
				rowData[17] = getStringValue(nationalityName);
				Object idNumber = basicInfo.get("idNumber");
				rowData[18] = getStringValue(idNumber);
				Object permanentAddress = basicInfo.get("permanentAddress");
				rowData[19] = getStringValue(permanentAddress);
				//[end]
				//[start] 20-39
				Object permanentAddressPhone = basicInfo.get("permanentAddressPhone");
				rowData[20] = getStringValue(permanentAddressPhone);
				Object permanentAddressPostCode = basicInfo.get("permanentAddressPostCode");
				rowData[21] = getStringValue(permanentAddressPhone);
				Object workUnitAddress = basicInfo.get("workUnitAddress");
				rowData[22] = getStringValue(workUnitAddress);
				Object workUnitPhone = basicInfo.get("workUnitPhone");
				rowData[23] = getStringValue(workUnitPhone);
				Object workUnitPostCode = basicInfo.get("workUnitPostCode");
				rowData[24] = getStringValue(workUnitPostCode);
				Object registeredAddress = basicInfo.get("registeredAddress");
				rowData[25] = getStringValue(registeredAddress);
				Object registeredAddressPostCode = basicInfo.get("registeredAddressPostCode");
				rowData[26] = getStringValue(registeredAddressPostCode);
				Object linkManName = basicInfo.get("linkManName");
				rowData[27] = getStringValue(linkManName);
				Object linkManRelativeRelationName = basicInfo.get("linkManRelativeRelationName");
				rowData[28] = getStringValue(linkManRelativeRelationName);
				Object linkManAddress = basicInfo.get("linkManAddress");
				rowData[29] = getStringValue(linkManAddress);
				Object inHospitalTypeCode = basicInfo.get("inHospitalTypeCode");
				rowData[30] = getStringValue(inHospitalTypeCode);
				Object linkManPhone = basicInfo.get("linkManPhone");
				rowData[31] = getStringValue(linkManPhone);
				Object inHospitalDateTime = basicInfo.get("inHospitalDateTime");
				rowData[32] = getDateTime(inHospitalDateTime);
				Object inDeptCode = basicInfo.get("inDeptCode");
				rowData[33] = getStringValue(inDeptCode);
				Object inHospitalHouseName = basicInfo.get("inHospitalHouseName");
				rowData[34] = getStringValue(inHospitalHouseName);
				rowData[35] = null;
				Object outHospitalDateTime = basicInfo.get("outHospitalDateTime");
				rowData[36] = getDateTime(outHospitalDateTime);
				Object outDeptCode = basicInfo.get("outDeptCode");
				rowData[37] = getStringValue(outDeptCode);
				Object outHospitalHouseName = basicInfo.get("outHospitalHouseName");
				rowData[38] = getStringValue(outHospitalHouseName);
				Object inHospitalDayNumber = basicInfo.get("inHospitalDayNumber");
				rowData[39] = getIntegerValue(inHospitalDayNumber);
				//[end]

				Map<String, Object> diseaseDiagInfo = (Map<String, Object>)jsonMap.get("hqmsDiseaseDiagInfo");
				if(diseaseDiagInfo != null){
					addDiagOfPageIndexHQMS(diseaseDiagInfo,rowData);
				}
				Map<String, Object> infectionInfo = (Map<String, Object>)jsonMap.get("infectionInfo");
				if(infectionInfo != null){
					Object infectionTotalTimesOjb = infectionInfo.get("infectionTotalTimes");
					if(infectionTotalTimesOjb != null){
						rowData[90] = getIntegerValue(infectionTotalTimesOjb);
					}
				}
				Object autopsyCode = basicInfo.get("autopsyCode");
				rowData[282] = getStringValue(autopsyCode);
				BigDecimal babyAge= null;
				if(yearOfAge == null){

					Object monthOfAge = basicInfo.get("monthOfAge");
					Object dayOfAge = basicInfo.get("dayOfAge");

					if(monthOfAge != null){
						babyAge = new BigDecimal((int)monthOfAge);
						if(dayOfAge != null){
							double babyMonth = (int)dayOfAge/30.0;
							babyAge = babyAge.add(new BigDecimal(babyMonth));
						}
					}else{
						if(dayOfAge != null){
							babyAge = BigDecimal.ZERO;
							double babyMonth = (int)dayOfAge/30.0;
							babyAge = babyAge.add(new BigDecimal(babyMonth));
						}
					}
				}
				rowData[299] = babyAge;

				Object outHospitalTypeCode = basicInfo.get("outHospitalTypeCode");
				rowData[313] = getStringValue(outHospitalTypeCode);

				if(outHospitalTypeCode != null){
					Object receiveUnitName = basicInfo.get("receiveUnitName");
					if("2".equals((String)outHospitalTypeCode)){
						rowData[314] = receiveUnitName;
					}else if("3".equals((String)outHospitalTypeCode)){
						rowData[315] = receiveUnitName;
					}
				}

				addCureOfPageIndexHQMS(cureInfo,rowData);
				addOperateOfPageIndexHQMS(operateInfo,rowData);
				addNurseOfPageIndexHQMS(nurseInfo,rowData);
				addIntensiveCareOfPageIndexHQMS(intensiveCareInfo,rowData);
				addCostOfPageIndexHQMS(costInfo,rowData);
				/*Object outHospitalDateTime = basicInfo.get("outHospitalDateTime");
				rowData[10] = getDateToHour(outHospitalDateTime);*/
				writer.addRecord(rowData);
			}

		}
	}
	private static void addCureOfPageIndexHQMS(Map<String, Object> cureInfo,Object[] rowData){
		if(cureInfo != null){
			Object hbsAgeResultCode = cureInfo.get("hbsAgeResultCode");
			rowData[108] = getStringValue(hbsAgeResultCode);
			Object hcvAbResultCode = cureInfo.get("hcvAbResultCode");
			rowData[109] = getStringValue(hcvAbResultCode);
			Object hivAbResultCode = cureInfo.get("hivAbResultCode");
			rowData[110] = getStringValue(hivAbResultCode);
			List<Map<String, Object>> diagAccordRecords = (List<Map<String, Object>>)cureInfo.get("diagAccordRecords");
			for (Map<String, Object> diagAccordRecord : diagAccordRecords) {

				String diagCompareCode = StringUtil.meaningStr((String)diagAccordRecord.get("diagCompareCode"));
				String diagAccordCode = StringUtil.meaningStr((String)diagAccordRecord.get("diagAccordCode"));
				if(diagCompareCode != null){
					if("A01".equalsIgnoreCase(diagCompareCode)){
						rowData[111] = diagAccordCode;
					}else if("A02".equalsIgnoreCase(diagCompareCode)){
						rowData[112] = diagAccordCode;
					}else if("A03".equalsIgnoreCase(diagCompareCode)){
						rowData[113] = diagAccordCode;
					}else if("A04".equalsIgnoreCase(diagCompareCode)){
						rowData[114] = diagAccordCode;
					}else if("A05".equalsIgnoreCase(diagCompareCode)){
						rowData[115] = diagAccordCode;
					}
				}
			}
			Object rescueNumber = cureInfo.get("rescueNumber");
			rowData[116] = getIntegerValue(rescueNumber);
			Object rescueSucceedNumber = cureInfo.get("rescueSucceedNumber");
			rowData[117] = getIntegerValue(rescueSucceedNumber);
			Object malignantTumorHighestDiagBasisCode = cureInfo.get("malignantTumorHighestDiagBasisCode");
			rowData[118] = getStringValue(malignantTumorHighestDiagBasisCode);
			Object malignantTumorDifferentDegreeCode = cureInfo.get("malignantTumorDifferentDegreeCode");
			rowData[119] = getStringValue(malignantTumorDifferentDegreeCode);

			//[start] 120-132
			List<Map<String, Object>> cureWorkers = (List<Map<String, Object>>)cureInfo.get("cureWorkers");
			String workerA1001Name=null;
			String workerA1003Name=null;
			String workerA2001Name=null;
			String workerA2003Name=null;
			String workerA2005Name=null;
			String workerA3001Name=null;
			String workerA2006Name=null;
			String workerA2007Name=null;
			String workerA2008Name=null;
			String workerA4001Name=null;
			String workerA2009Name=null;
			String workerA3003Name=null;
			for (Map<String, Object> cureWorker : cureWorkers) {
				String professionTitleCode = (String)cureWorker.get("professionTitleCode");
				if("A1001".equals(professionTitleCode)){
					workerA1001Name = (String)cureWorker.get("medicalWorkerName");
				}else if("A1003".equals(professionTitleCode)){
					workerA1003Name = (String)cureWorker.get("medicalWorkerName");
				}else if("A2001".equals(professionTitleCode)){
					workerA2001Name = (String)cureWorker.get("medicalWorkerName");
				}else if("A2003".equals(professionTitleCode)){
					workerA2003Name = (String)cureWorker.get("medicalWorkerName");
				}else if("A2005".equals(professionTitleCode)){
					workerA2005Name = (String)cureWorker.get("medicalWorkerName");
				}else if("A3001".equals(professionTitleCode)){
					workerA3001Name = (String)cureWorker.get("medicalWorkerName");
				}else if("A2006".equals(professionTitleCode)){
					workerA2006Name = (String)cureWorker.get("medicalWorkerName");
				}else if("A2007".equals(professionTitleCode)){
					workerA2007Name = (String)cureWorker.get("medicalWorkerName");
				}
				else if("A2008".equals(professionTitleCode)){
					workerA2008Name = (String)cureWorker.get("medicalWorkerName");
				}else if("A4001".equals(professionTitleCode)){
					workerA4001Name = (String)cureWorker.get("medicalWorkerName");
				}else if("A2009".equals(professionTitleCode)){
					workerA2009Name = (String)cureWorker.get("medicalWorkerName");
				}else if("A3003".equals(professionTitleCode)){
					workerA3003Name = (String)cureWorker.get("medicalWorkerName");
				}
			}
			rowData[120]=workerA1001Name;
			rowData[121]=workerA2001Name;
			rowData[122]=workerA2003Name;
			rowData[123]=workerA2005Name;
			rowData[124]=workerA3001Name;
			rowData[125]=workerA2006Name;
			rowData[126]=workerA2007Name;
			rowData[127]=workerA2008Name;
			rowData[128]=workerA4001Name;
			Object medicalRecordQualityCode = cureInfo.get("medicalRecordQualityCode");
			rowData[129] = getStringValue(medicalRecordQualityCode);
			rowData[130]=workerA2009Name;
			rowData[131]=workerA3003Name;
			Object qualityControlDateTimeObj = cureInfo.get("qualityControlDateTime");
			rowData[132]=getDateToDay(qualityControlDateTimeObj);
			//[end]
			Object isFirstCaseCode = cureInfo.get("isFirstCaseCode");
			rowData[283] = getStringValue(isFirstCaseCode);
			Object followUpClinicLimitCode = cureInfo.get("followUpClinicLimitCode");
			rowData[285] = getStringValue(followUpClinicLimitCode);
			Object followUpClinicWeekNumber = cureInfo.get("followUpClinicWeekNumber");
			rowData[286] = getBigDecimalValue(followUpClinicWeekNumber);
			Object followUpClinicMonthNumber = cureInfo.get("followUpClinicMonthNumber");
			rowData[287] = getBigDecimalValue(followUpClinicMonthNumber);
			Object followUpClinicYearNumber = cureInfo.get("followUpClinicYearNumber");
			rowData[288] = getBigDecimalValue(followUpClinicYearNumber);
			Object isTeachingCaseCode = cureInfo.get("isTeachingCaseCode");
			rowData[289] = getStringValue(isTeachingCaseCode);
			Object bloodTypeCode = cureInfo.get("bloodTypeCode");
			rowData[290] = getStringValue(bloodTypeCode);
			Object rhBloodTypeCode = cureInfo.get("rhBloodTypeCode");
			rowData[291] = getStringValue(rhBloodTypeCode);

			Object babyBirthWeight = cureInfo.get("babyBirthWeight");
			rowData[300] = getIntegerValue(babyBirthWeight);

			Object babyInHospitalWeight = cureInfo.get("babyInHospitalWeight");
			rowData[305] = getIntegerValue(babyInHospitalWeight);
			Object hourOfBeforeInHospitalComa = cureInfo.get("hourOfBeforeInHospitalComa");
			rowData[306] = getIntegerValue(hourOfBeforeInHospitalComa);
			Object minuteOfBeforeInHospitalComa = cureInfo.get("minuteOfBeforeInHospitalComa");
			rowData[307] = getIntegerValue(minuteOfBeforeInHospitalComa);
			Object hourOfAfterInHospitalComa = cureInfo.get("hourOfAfterInHospitalComa");
			rowData[308] = getIntegerValue(hourOfAfterInHospitalComa);
			Object minuteOfAfterInHospitalComa = cureInfo.get("minuteOfAfterInHospitalComa");
			rowData[309] = getIntegerValue(minuteOfAfterInHospitalComa);
			rowData[310] = null;
			Object rehospitalAimOf31Code = cureInfo.get("rehospitalAimOf31Code");
			rowData[311] = getStringValue(rehospitalAimOf31Code);

			Object rehospitalAimOf31Description = cureInfo.get("rehospitalAimOf31Description");
			rowData[312] = getStringValue(rehospitalAimOf31Description);


		}


	}
	private static void addDiagOfPageIndexHQMS(Map<String, Object> diseaseDiagInfo,Object[] rowData){
		//[start] 40-49
		Map<String, Object> outpatientDiagRecord = (Map<String, Object>)diseaseDiagInfo.get("outpatientDiagRecord");
		if(outpatientDiagRecord != null){
			Object outpatientDiagCode = outpatientDiagRecord.get("diseaseDiagCode");
			rowData[40] = getStringValue(outpatientDiagCode);
			Object outpatientDiagOriginalDesc = outpatientDiagRecord.get("diseaseDiagOriginalDesc");
			/*if(outpatientDiagOriginalDesc != null){
				rowData[41] = getStringValue(outpatientDiagOriginalDesc);
			}else{
				Object outpatientDiseaseDiagName = outpatientDiagRecord.get("diseaseDiagName");
				rowData[41] = getStringValue(outpatientDiseaseDiagName);
			}
			*/

			Object outpatientDiseaseDiagName = outpatientDiagRecord.get("diseaseDiagName");
			rowData[41] = getStringValue(outpatientDiseaseDiagName);
			rowData[42] = null;

		}
		rowData[43] = null;
		rowData[44] = null;
		rowData[45] = null;
		Map<String, Object> mainDiagRecord = (Map<String, Object>)diseaseDiagInfo.get("mainDiagRecord");
		if(mainDiagRecord != null){
			Object mainDiseaseDiagCode = mainDiagRecord.get("diseaseDiagCode");
			rowData[46] = getStringValue(mainDiseaseDiagCode);
			Object mainDiseaseDiagOriginalDesc = mainDiagRecord.get("diseaseDiagOriginalDesc");
			if(mainDiseaseDiagOriginalDesc != null){
				rowData[47] = getStringValue(mainDiseaseDiagOriginalDesc);
			}else{
				Object  mainDiseaseDiagName = mainDiagRecord.get("diseaseDiagName");
				rowData[47] = getStringValue(mainDiseaseDiagName);
			}

			Object mainInHospitalDiseaseStateCode = mainDiagRecord.get("inHospitalDiseaseStateCode");
			rowData[48] = getStringValue(mainInHospitalDiseaseStateCode);
			Object mainTreatResultCode = mainDiagRecord.get("treatResultCode");
			rowData[49] = getStringValue(mainTreatResultCode);
		}

		//[end]

		//[start] 50-89
		List<Map<String, Object>> ohterDiseaseDiagRecords = (List<Map<String, Object>>)diseaseDiagInfo.get("diseaseDiagRecords");
		int ohterDiseaseDiagRecordIndex = 0;
		for (Map<String, Object> ohterDiseaseDiagRecord : ohterDiseaseDiagRecords) {
			ohterDiseaseDiagRecordIndex++;
			if(ohterDiseaseDiagRecordIndex >10){
				break;
			}
			Object ohterDiseaseDiagCode = ohterDiseaseDiagRecord.get("diseaseDiagCode");
			rowData[50+(ohterDiseaseDiagRecordIndex-1)*4] = getStringValue(ohterDiseaseDiagCode);

			Object ohterDiseaseDiagOriginalDesc = ohterDiseaseDiagRecord.get("diseaseDiagOriginalDesc");
			if(ohterDiseaseDiagOriginalDesc != null){
				rowData[51+(ohterDiseaseDiagRecordIndex-1)*4] = getStringValue(ohterDiseaseDiagOriginalDesc);
			}else{
				Object ohterDiseaseDiagName = ohterDiseaseDiagRecord.get("diseaseDiagName");
				rowData[51+(ohterDiseaseDiagRecordIndex-1)*4] = getStringValue(ohterDiseaseDiagName);
			}
			Object ohterInHospitalDiseaseStateCode = ohterDiseaseDiagRecord.get("inHospitalDiseaseStateCode");
			rowData[52+(ohterDiseaseDiagRecordIndex-1)*4] = getStringValue(ohterInHospitalDiseaseStateCode);
			Object otherTreatResultCode = ohterDiseaseDiagRecord.get("treatResultCode");
			rowData[53+(ohterDiseaseDiagRecordIndex-1)*4] = getStringValue(otherTreatResultCode);
		}
		//[end]

		//[start] 91-105

		List<Map<String, Object>> pathologyDiagRecords = (List<Map<String, Object>>)diseaseDiagInfo.get("pathologyDiagRecords");
		int pathologyDiagRecordIndex = 0;
		for (Map<String, Object> pathologyDiagRecord : pathologyDiagRecords) {
			if(pathologyDiagRecordIndex >2 ){
				break;
			}
			Object pathologyDiseaseDiagCode = pathologyDiagRecord.get("diseaseDiagCode");
			rowData[91+pathologyDiagRecordIndex*3] = getStringValue(pathologyDiseaseDiagCode);
			Object pathologyDiseaseDiagOriginalDesc = pathologyDiagRecord.get("diseaseDiagOriginalDesc");
			if(pathologyDiseaseDiagOriginalDesc != null){
				rowData[92+pathologyDiagRecordIndex*3] = getStringValue(pathologyDiseaseDiagOriginalDesc);
			}else{
				Object pathologyDiseaseDiagName = pathologyDiagRecord.get("diseaseDiagName");
				rowData[92+pathologyDiagRecordIndex*3] = getStringValue(pathologyDiseaseDiagName);
			}

			Object pathologyNumber = pathologyDiagRecord.get("pathologyNumber");
			rowData[93+pathologyDiagRecordIndex*3] = getStringValue(pathologyNumber);
			pathologyDiagRecordIndex++;
		}


		List<Map<String, Object>> damageAndVenenationDiagRecords = (List<Map<String, Object>>)diseaseDiagInfo.get("damageAndVenenationDiagRecords");
		int damageAndVenenationDiagRecordIndex = 0;
		for (Map<String, Object> damageAndVenenationDiagRecord : damageAndVenenationDiagRecords) {
			if(damageAndVenenationDiagRecordIndex >2 ){
				break;
			}
			Object damageAndVenenationDiseaseDiagCode = damageAndVenenationDiagRecord.get("diseaseDiagCode");
			rowData[100+damageAndVenenationDiagRecordIndex*2] = getStringValue(damageAndVenenationDiseaseDiagCode);

			Object damageAndVenenationDiseaseDiagOriginalDesc = damageAndVenenationDiagRecord.get("diseaseDiagOriginalDesc");
			if(damageAndVenenationDiseaseDiagOriginalDesc != null){
				rowData[101+damageAndVenenationDiagRecordIndex*2] = getStringValue(damageAndVenenationDiseaseDiagOriginalDesc);
			}else{
				Object damageAndVenenationDiseaseDiagName = damageAndVenenationDiagRecord.get("diseaseDiagName");
				rowData[101+damageAndVenenationDiagRecordIndex*2] = getStringValue(damageAndVenenationDiseaseDiagName);

			}

			damageAndVenenationDiagRecordIndex++;
		}

		//[end]

		//[start] 90-39
		//[end]
	}

	private static void addOperateOfPageIndexHQMS(Map<String, Object> operateInfo,Object[] rowData){
		if(operateInfo != null){
			List<Map<String, Object>> operateRecords = (List<Map<String, Object>>)operateInfo.get("operateRecords");
			int operateRecordIndex = 0;
			for (Map<String, Object> operateRecord : operateRecords) {
				operateRecordIndex++;
				if(operateRecordIndex >10){
					break;
				}
				Object operateCode = operateRecord.get("operateCode");
				rowData[133+(operateRecordIndex-1)*13]=getStringValue(operateCode);
				Object operateStartDateObj = operateRecord.get("operateStartDate");
				rowData[134+(operateRecordIndex-1)*13]=getDateTime(operateStartDateObj);
				Object opsLevelCode = operateRecord.get("opsLevelCode");
				rowData[135+(operateRecordIndex-1)*13]=getStringValue(opsLevelCode);
				/*Object patientSourceCode = operateRecord.get("patientSourceCode");
				rowData[136+(operateRecordIndex-1)*12]=getStringValue(patientSourceCode);*/
				Object operateOriginalDesc = operateRecord.get("operateOriginalDesc");
				Object operateName = operateRecord.get("operateName");
				/*if(operateOriginalDesc != null){
					rowData[136+(operateRecordIndex-1)*13]=getStringValue(operateOriginalDesc);
				}else{
					rowData[136+(operateRecordIndex-1)*13]=getStringValue(operateName);
				}*/
				rowData[136+(operateRecordIndex-1)*13]=getStringValue(operateName);
				Object operateBodyPartCodes = operateRecord.get("operateBodyPartCodes");
				rowData[137+(operateRecordIndex-1)*13]=getStringValue(operateBodyPartCodes);

				Object operateDurationTime = operateRecord.get("operateDurationTime");
				rowData[138+(operateRecordIndex-1)*13] = getBigDecimalValue(operateDurationTime);
				List<Map<String, Object>> operateWorkers = (List<Map<String, Object>>)operateRecord.get("operateWorkers");
				String workerA5001Name=null;
				String workerA5002Name=null;
				String workerA5003Name=null;
				String workerA5004Name=null;
				for (Map<String, Object> operateWorker : operateWorkers) {
					String professionTitleCode = (String)operateWorker.get("professionTitleCode");
					if("A5001".equalsIgnoreCase(professionTitleCode)){
						workerA5001Name = (String)operateWorker.get("medicalWorkerName");
					}else if("A5002".equalsIgnoreCase(professionTitleCode)){
						workerA5002Name = (String)operateWorker.get("medicalWorkerName");
					}else if("A5003".equalsIgnoreCase(professionTitleCode)){
						workerA5003Name = (String)operateWorker.get("medicalWorkerName");
					}else if("A5004".equalsIgnoreCase(professionTitleCode)){
						workerA5004Name = (String)operateWorker.get("medicalWorkerName");
					}
				}
				rowData[139+(operateRecordIndex-1)*13]=workerA5001Name;
				rowData[140+(operateRecordIndex-1)*13]=workerA5003Name;
				rowData[141+(operateRecordIndex-1)*13]=workerA5004Name;

				Object anaesthesiaTypeCode = operateRecord.get("anaesthesiaTypeCode");
				rowData[142+(operateRecordIndex-1)*13]=getStringValue(anaesthesiaTypeCode);

				Object anaesthesiaLevelCode = operateRecord.get("anaesthesiaLevelCode");
				rowData[143+(operateRecordIndex-1)*13]=getStringValue(anaesthesiaLevelCode);
				rowData[144+(operateRecordIndex-1)*13]= null;
				rowData[145+(operateRecordIndex-1)*13]=workerA5002Name;

				Object incisionLevelCode = operateRecord.get("incisionLevelCode");

				Object cicatrizeTypeCode = operateRecord.get("cicatrizeTypeCode");


			}
		}
	}

	private static void addNurseOfPageIndexHQMS(Map<String, Object> nurseInfo,Object[] rowData){
		if(nurseInfo != null){
			Object specialNurseDayNumber = nurseInfo.get("specialNurseDayNumber");
			rowData[263]=getIntegerValue(specialNurseDayNumber);
			Object firstLevelNurseDayNumber = nurseInfo.get("firstLevelNurseDayNumber");
			rowData[264]=getIntegerValue(firstLevelNurseDayNumber);
			Object secondLevelNurseDayNumber = nurseInfo.get("secondLevelNurseDayNumber");
			rowData[265]=getIntegerValue(secondLevelNurseDayNumber);
			Object threeLevelNurseDayNumber = nurseInfo.get("threeLevelNurseDayNumber");
			rowData[266]=getIntegerValue(threeLevelNurseDayNumber);
		}
	}

	private static void addIntensiveCareOfPageIndexHQMS(Map<String, Object> intensiveCareInfo,Object[] rowData){
		if(intensiveCareInfo != null){
			List<Map<String, Object>> intensiveCareRecords = (List<Map<String, Object>>)intensiveCareInfo.get("intensiveCareRecords");
			int intensiveCareRecordIndex = 0;
			for (Map<String, Object> intensiveCareRecord : intensiveCareRecords) {
				intensiveCareRecordIndex++;
				if(intensiveCareRecordIndex >5){
					break;
				}
				Object icuTypeName = intensiveCareRecord.get("icuTypeName");
				rowData[267+(intensiveCareRecordIndex-1)*3]=getStringValue(icuTypeName);
				Object inIcuDateTime = intensiveCareRecord.get("inIcuDateTime");
				rowData[268+(intensiveCareRecordIndex-1)*3]=getDateToDay(inIcuDateTime);
				Object outIcuDateTime = intensiveCareRecord.get("outIcuDateTime");
				rowData[269+(intensiveCareRecordIndex-1)*3]=getDateToDay(outIcuDateTime);
			}
		}
	}


	private static void addCostOfPageIndexHQMS(Map<String, Object> costInfo,Object[] rowData){
		if(costInfo != null){
			Object totalCost = costInfo.get("totalCost");
			rowData[316] = getBigDecimalValue(totalCost);
			Object selfCost = costInfo.get("selfCost");
			rowData[317] = getBigDecimalValue(selfCost);
			List<Map<String, Object>> costRecords = (List<Map<String, Object>>)costInfo.get("costRecords");
			int costRecordIndex = 0;
			for (Map<String, Object> costRecord : costRecords) {
				Object medicalCostTypeCode = costRecord.get("medicalCostTypeCode");
				Object costMoney = costRecord.get("costMoney");
				if(("C01001").equalsIgnoreCase((String)medicalCostTypeCode)){
					Object costC01001 = costMoney;
					rowData[318] = getBigDecimalValue(costC01001);
				}else if(("C01002").equalsIgnoreCase((String)medicalCostTypeCode)){
					Object costC01002 = costMoney;
					rowData[319] = getBigDecimalValue(costC01002);
				}else if(("C01003").equalsIgnoreCase((String)medicalCostTypeCode)){
					Object costC01003 = costMoney;
					rowData[320] = getBigDecimalValue(costC01003);
				}else if(("C01999").equalsIgnoreCase((String)medicalCostTypeCode)){
					Object costC01999 = costMoney;
					rowData[321] = getBigDecimalValue(costC01999);
				}else if(("C02001").equalsIgnoreCase((String)medicalCostTypeCode)){
					Object costC02001 = costMoney;
					rowData[322] = getBigDecimalValue(costC02001);
				}else if(("C02002").equalsIgnoreCase((String)medicalCostTypeCode)){
					Object costC02002 = costMoney;
					rowData[323] = getBigDecimalValue(costC02002);
				}else if(("C02003").equalsIgnoreCase((String)medicalCostTypeCode)){
					Object costC02003 = costMoney;
					rowData[324] = getBigDecimalValue(costC02003);
				}else if(("C02004").equalsIgnoreCase((String)medicalCostTypeCode)){
					Object costC02004 = costMoney;
					rowData[325] = getBigDecimalValue(costC02004);
				}else if(("C03001").equalsIgnoreCase((String)medicalCostTypeCode)){
					Object costC03001 = costMoney;
					rowData[326] = getBigDecimalValue(costC03001);
				}else if(("C03002").equalsIgnoreCase((String)medicalCostTypeCode)){
					Object costC03002 = costMoney;
					rowData[327] = getBigDecimalValue(costC03002);
				}else if(("C03003").equalsIgnoreCase((String)medicalCostTypeCode)){
					Object costC03003 = costMoney;
					rowData[328] = getBigDecimalValue(costC03003);
				}else if(("C03004").equalsIgnoreCase((String)medicalCostTypeCode)){
					Object costC03004 = costMoney;
					rowData[329] = getBigDecimalValue(costC03004);
				}else if(("C03005").equalsIgnoreCase((String)medicalCostTypeCode)){
					Object costC03005 = costMoney;
					rowData[330] = getBigDecimalValue(costC03005);
				}else if(("C04001").equalsIgnoreCase((String)medicalCostTypeCode)){
					Object costC04001 = costMoney;
					rowData[331] = getBigDecimalValue(costC04001);
				}else if(("C05001").equalsIgnoreCase((String)medicalCostTypeCode)){
					Object costC05001 = costMoney;
					rowData[332] = getBigDecimalValue(costC05001);
				}else if(("C06001").equalsIgnoreCase((String)medicalCostTypeCode)){
					Object costC06001 = costMoney;
					rowData[333] = getBigDecimalValue(costC06001);
				}else if(("C06002").equalsIgnoreCase((String)medicalCostTypeCode)){
					Object costC06002 = costMoney;
					rowData[334] = getBigDecimalValue(costC06002);
				}else if(("C07001").equalsIgnoreCase((String)medicalCostTypeCode)){
					Object costC07001 = costMoney;
					rowData[335] = getBigDecimalValue(costC07001);
				}else if(("C07002").equalsIgnoreCase((String)medicalCostTypeCode)){
					Object costC07002 = costMoney;
					rowData[336] = getBigDecimalValue(costC07002);
				}else if(("C08001").equalsIgnoreCase((String)medicalCostTypeCode)){
					Object costC08001 = costMoney;
					rowData[337] = getBigDecimalValue(costC08001);
				}else if(("C08002").equalsIgnoreCase((String)medicalCostTypeCode)){
					Object costC08002 = costMoney;
					rowData[338] = getBigDecimalValue(costC08002);
				}else if(("C08003").equalsIgnoreCase((String)medicalCostTypeCode)){
					Object costC08003 = costMoney;
					rowData[339] = getBigDecimalValue(costC08003);
				}else if(("C08004").equalsIgnoreCase((String)medicalCostTypeCode)){
					Object costC08004 = costMoney;
					rowData[340] = getBigDecimalValue(costC08004);
				}else if(("C08005").equalsIgnoreCase((String)medicalCostTypeCode)){
					Object costC08005 = costMoney;
					rowData[341] = getBigDecimalValue(costC08005);
				}else if(("C09001").equalsIgnoreCase((String)medicalCostTypeCode)){
					Object costC09001 = costMoney;
					rowData[342] = getBigDecimalValue(costC09001);
				}else if(("C09002").equalsIgnoreCase((String)medicalCostTypeCode)){
					Object costC09002 = costMoney;
					rowData[343] = getBigDecimalValue(costC09002);
				}else if(("C09003").equalsIgnoreCase((String)medicalCostTypeCode)){
					Object costC09003 = costMoney;
					rowData[344] = getBigDecimalValue(costC09003);
				}else if(("C99999").equalsIgnoreCase((String)medicalCostTypeCode)){
					Object costC99999 = costMoney;
					rowData[345] = getBigDecimalValue(costC99999);
				}


			}

		}
	}
	private static Object getStringValue(Object obj){
		if(obj instanceof String){
			return (String)obj;
		}else{
			return null;
		}
	}

	private static Object getBigDecimalValue(Object obj){
		if(obj == null){
			return null;
		}
		if(obj instanceof BigDecimal){
			return (BigDecimal)obj;
		}else if(obj instanceof Double){
			return new BigDecimal((Double)obj);
		}
		else if(obj instanceof Integer){
			return new BigDecimal((Integer)obj);
		}
		else if(obj instanceof String){
			return new BigDecimal((String)obj);
		}
		else{
			return null;
		}
	}

	private static Object getIntegerValue(Object obj){
		if(obj instanceof Integer){
			return new Double((Integer)obj).intValue();
		}else if(obj instanceof BigDecimal){
			return ((BigDecimal)obj).intValue();
		}else if(obj instanceof Long){
			return ((Long)obj).intValue();
		}else if(obj instanceof Long){
			return ((Double)obj).intValue();
		}else{
			return null;
		}
	}

	private static Date getDateToDay(Object obj){
		if(obj instanceof String){

			try {
				return DateUtil.dateParse((String)obj);
			} catch (ParseException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
				return null;
			}
		}else{
			return null;
		}
	}

	private static Date getDateToHour(Object obj){
		if(obj instanceof String){

			try {
				return DateUtil.dateParse("YYYY-MM-DD HH",(String)obj);
			} catch (ParseException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
				return null;
			}
		}else{
			return null;
		}
	}

	private static Date getDateTime(Object obj){
		if(obj instanceof String){

			try {
				return DateUtil.dateParse("YYYY-MM-DD HH:mm:ss",(String)obj);
			} catch (ParseException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
				return null;
			}
		}else{
			return null;
		}
	}

}
